cc.Class({
    extends: cc.Component,

    properties: {
        label: cc.RichText,
        orderId:0,
        exitTime: 300,
        stayTime: 60,
        fadeAni:false,
        count: 0
    },
    initInfo(param){
        this.label.string = param.text
        this.orderId = param.orderId
        if (param.exitTime) {
            this.exitTime = param.exitTime
        }else{
            this.exitTime = 300
        }
        this.node.opacity = 255
    },
    checkTip(){
        if (this.node.y > 100 && !this.fadeAni){
            this.fadeAni = true
            this.node.runAction(cc.fadeOut(1))
        }
        if (this.count > this.exitTime || this.opacity == 0) {
            this.count = 0
            this.node.y = 0
            gg.uiManager.delTip(this.orderId)
            this.node.stopAllActions()
            this.fadeAni = false
            this.orderId = 0
            he.pool.putElement("tip",this.node)
        }
    },
    update (dt) {
        this.count += 1
        if(this.count > this.stayTime){
            this.node.y += 2
        }
        this.checkTip()
    },
});
